package ca.bcit.comp_3512.assignment_02.data_models;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="weekly_entries")
public class WeeklyEntry implements Serializable
{
    private static final long serialVersionUID = 1L;
    
    @ManyToOne
    @JoinColumn(name="user_id", referencedColumnName="user_id", insertable=false, updatable=false)
    private User user;
    
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name="unique_id")
    private Integer uniqueID;
    
    @Column(name="friday")
    private Double friday;
    
    @Column(name="monday")
    private Double monday;
    
    @Column(name="notes", columnDefinition="TEXT")
    private String notes;
    
    @Column(name="project_id")
    private Integer projectID;
    
    @Column(name="saturday")
    private Double saturday;
    
    @Column(name="sunday")
    private Double sunday;
    
    @Column(name="thursday")
    private Double thursday;
    
    @Column(name="tuesday")
    private Double tuesday;
    
    @Column(name="user_id")
    private Integer userID;
    
    @Column(name="wednesday")
    private Double wednesday;
    
    @Column(name="week", columnDefinition="TINYINT")
    private Integer week;
    
    @Column(name="work_place_id")
    private String workPlaceID;
    
    @Column(name="year")
    private Integer year;
    
    public WeeklyEntry() {}
    
    public Integer getUniqueID() { return this.uniqueID; }
    public Double getFriday() { return this.friday; }
    public Double getMonday() { return this.monday; }
    public String getNotes() { return this.notes; }
    public Integer getProjectID() { return this.projectID; }
    public Double getSaturday() { return this.saturday; }
    public Double getSunday() { return this.sunday; }
    public Double getThursday() { return this.thursday; }
    public Double getTuesday() { return this.tuesday; }
    public Integer getUserID() { return this.userID; }
    public Double getWednesday() { return this.wednesday; }
    public Integer getWeek() { return this.week; }
    public String getWorkPlaceID() { return this.workPlaceID; }
    public Integer getYear() { return this.year; }
    public User getUser() {return this.user; }
    
    //not needed as it has no effect
    //public void setUniqueID(Integer unique) { this.uniqueID = uniqueID;}
    public void setFriday(Double friday) { this.friday = friday; }
    public void setMonday(Double monday) { this.monday = monday; }
    public void setNotes(String notes) { this.notes = notes; }
    public void setProjectID(Integer projectID) { this.projectID = projectID; }
    public void setSaturday(Double saturday) { this.saturday = saturday; }
    public void setSunday(Double sunday) { this.sunday = sunday; }
    public void setThursday(Double thursday) { this.thursday = thursday; }
    public void setTuesday(Double tuesday) { this.tuesday = tuesday; }
    public void setUserID(Integer userID) { this.userID = userID; }
    public void setWednesday(Double wednesday) { this.wednesday = wednesday; }
    public void setWeek(Integer week) { this.week = week; }
    public void setWorkPlaceID(String workPlaceID) {this.workPlaceID = workPlaceID; }
    public void setYear(Integer year) { this.year = year; }
    public void setUser(User user) { this.user = user; }
}
